<?php

App::uses('AppModel', 'Model');
App::uses('LogsDao','Model');

class TestDao extends AppModel {
	
	public $useTable = false;
	var $logsDao;
	
	function __construct(){
		
		$this->logsDao = new LogsDao();
	}

    public function prueba(){
        return $this->query("SELECT * FROM cursos"); 
    }
    
    
    public function setText(){
    	return $this->query("SELECT * FROM cursos");
    }
 
    public function getText($id){
    	$queryString = "Select * from cursos WHERE id_curs=".$id." AND idioma='cat'";
    	$returnValue = $this->query($queryString);
    	return $returnValue[0]->text_curs;
    }
    
    public function insertText($text){
    	$queryString = "INSERT INTO test (id,text) VALUES (NULL,'".$text."'); " ;
    	return $this->query($queryString);
    }
    
    public function updateText($id,$text){
    	$queryString = "UPDATE test SET text = '".$text."' WHERE id = '".$id."';";
    	return $this->query($queryString);
    }
    
    
}



?>